1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module adw.StatusPage; 26 27 private import adw.c.functions; 28 public import adw.c.types; 29 private import gdk.PaintableIF; 30 private import glib.ConstructionException; 31 private import glib.Str; 32 private import glib.c.functions; 33 private import gobject.ObjectG; 34 private import gtk.AccessibleIF; 35 private import gtk.AccessibleT; 36 private import gtk.BuildableIF; 37 private import gtk.BuildableT; 38 private import gtk.ConstraintTargetIF; 39 private import gtk.ConstraintTargetT; 40 private import gtk.Widget; 41 42 43 /** 44 * A page used for empty/error states and similar use-cases. 45 * 46 * <picture> 47 * <source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)"> 48 * <img src="status-page.png" alt="status-page"> 49 * </picture> 50 * 51 * The `AdwStatusPage` widget can have an icon, a title, a description and a 52 * custom widget which is displayed below them. 53 * 54 * ## CSS nodes 55 * 56 * `AdwStatusPage` has a main CSS node with name `statuspage`. 57 * 58 * `AdwStatusPage` can use the 59 * [`.compact`](style-classes.html#compact-status-page) style class for when it 60 * needs to fit into a small space such a sidebar or a popover. 61 * 62 * Since: 1.0 63 */ 64 public class StatusPage : Widget 65 { 66 /** the main Gtk struct */ 67 protected AdwStatusPage* adwStatusPage; 68 69 /** Get the main Gtk struct */ 70 public AdwStatusPage* getStatusPageStruct(bool transferOwnership = false) 71 { 72 if (transferOwnership) 73 ownedRef = false; 74 return adwStatusPage; 75 } 76 77 /** the main Gtk struct as a void* */ 78 protected override void* getStruct() 79 { 80 return cast(void*)adwStatusPage; 81 } 82 83 /** 84 * Sets our main struct and passes it to the parent class. 85 */ 86 public this (AdwStatusPage* adwStatusPage, bool ownedRef = false) 87 { 88 this.adwStatusPage = adwStatusPage; 89 super(cast(GtkWidget*)adwStatusPage, ownedRef); 90 } 91 92 93 /** */ 94 public static GType getType() 95 { 96 return adw_status_page_get_type(); 97 } 98 99 /** 100 * Creates a new `AdwStatusPage`. 101 * 102 * Returns: the newly created `AdwStatusPage` 103 * 104 * Since: 1.0 105 * 106 * Throws: ConstructionException GTK+ fails to create the object. 107 */ 108 public this() 109 { 110 auto __p = adw_status_page_new(); 111 112 if(__p is null) 113 { 114 throw new ConstructionException("null returned by new"); 115 } 116 117 this(cast(AdwStatusPage*) __p); 118 } 119 120 /** 121 * Gets the child widget of @self. 122 * 123 * Returns: the child widget of @self 124 * 125 * Since: 1.0 126 */ 127 public Widget getChild() 128 { 129 auto __p = adw_status_page_get_child(adwStatusPage); 130 131 if(__p is null) 132 { 133 return null; 134 } 135 136 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p); 137 } 138 139 /** 140 * Gets the description for @self. 141 * 142 * Returns: the description 143 * 144 * Since: 1.0 145 */ 146 public string getDescription() 147 { 148 return Str.toString(adw_status_page_get_description(adwStatusPage)); 149 } 150 151 /** 152 * Gets the icon name for @self. 153 * 154 * Returns: the icon name 155 * 156 * Since: 1.0 157 */ 158 public string getIconName() 159 { 160 return Str.toString(adw_status_page_get_icon_name(adwStatusPage)); 161 } 162 163 /** 164 * Gets the paintable for @self. 165 * 166 * Returns: the paintable 167 * 168 * Since: 1.0 169 */ 170 public PaintableIF getPaintable() 171 { 172 auto __p = adw_status_page_get_paintable(adwStatusPage); 173 174 if(__p is null) 175 { 176 return null; 177 } 178 179 return ObjectG.getDObject!(PaintableIF)(cast(GdkPaintable*) __p); 180 } 181 182 /** 183 * Gets the title for @self. 184 * 185 * Returns: the title 186 * 187 * Since: 1.0 188 */ 189 public string getTitle() 190 { 191 return Str.toString(adw_status_page_get_title(adwStatusPage)); 192 } 193 194 /** 195 * Sets the child widget of @self. 196 * 197 * Params: 198 * child = the child widget 199 * 200 * Since: 1.0 201 */ 202 public void setChild(Widget child) 203 { 204 adw_status_page_set_child(adwStatusPage, (child is null) ? null : child.getWidgetStruct()); 205 } 206 207 /** 208 * Sets the description for @self. 209 * 210 * Params: 211 * description = the description 212 * 213 * Since: 1.0 214 */ 215 public void setDescription(string description) 216 { 217 adw_status_page_set_description(adwStatusPage, Str.toStringz(description)); 218 } 219 220 /** 221 * Sets the icon name for @self. 222 * 223 * Params: 224 * iconName = the icon name 225 * 226 * Since: 1.0 227 */ 228 public void setIconName(string iconName) 229 { 230 adw_status_page_set_icon_name(adwStatusPage, Str.toStringz(iconName)); 231 } 232 233 /** 234 * Sets the paintable for @self. 235 * 236 * Params: 237 * paintable = the paintable 238 * 239 * Since: 1.0 240 */ 241 public void setPaintable(PaintableIF paintable) 242 { 243 adw_status_page_set_paintable(adwStatusPage, (paintable is null) ? null : paintable.getPaintableStruct()); 244 } 245 246 /** 247 * Sets the title for @self. 248 * 249 * Params: 250 * title = the title 251 * 252 * Since: 1.0 253 */ 254 public void setTitle(string title) 255 { 256 adw_status_page_set_title(adwStatusPage, Str.toStringz(title)); 257 } 258 }